﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UI/HRManagerUI/HrManager.Master"
    AutoEventWireup="true" CodeBehind="AddEmployeePersonalData.aspx.cs" Inherits="HRM.UI.HRManagerUI.EmpModule.AddEmployeePersonalData" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContentBody" runat="server">
    <link href="../../../Styles/Employee/AddEmployeePersonalInfoCss.css" rel="stylesheet"
        type="text/css" />
    <link href="../../../Scripts/htmlDatePicker.css" rel="stylesheet" type="text/css" />
    <script src="../../../Scripts/htmlDatePicker.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">

        function CheckValidation() {
            if (document.getElementById("<%=txtName.ClientID%>").value == "") {
                document.getElementById("<%=msgLabel.ClientID%>").textContent = "Please Enter Employee Name !";
                document.getElementById("<%=msgLabel.ClientID%>").style.color = "red";
                document.getElementById("<%=txtName.ClientID%>").focus();
                return false;
            }

            var ddlSex = document.getElementById('<%=ddlsex.ClientID%>');
            document.getElementById("<%=msgLabel.ClientID%>").style.color = "red";
            if (ddlSex.value == "-1") {
                alert("Sex  should not be blank.");
                ddlSex.focus();
                return false;
            }


            if (document.getElementById("<%=txtDob.ClientID%>").value == "") {
                document.getElementById("<%=msgLabel.ClientID%>").textContent = "Please Enter Employee Date of Birth !";
                document.getElementById("<%=msgLabel.ClientID%>").style.color = "red";
                document.getElementById("<%=txtDob.ClientID%>").focus();
                return false;
            }


            var emailPat = "^[a-z][a-z|0-9|]*([_][a-z|0-9]+)*([.][a-z|0-9]+([_][a-z|0-9]+)*)?@[a-z][a-z|0-9|]*\.([a-z][a-z|0-9]*(\.[a-z][a-z|0-9]*)?)$";
            var emailid = document.getElementById("<%=txtEmail.ClientID %>").value;
            var matchArray = emailid.match(emailPat);
            if (emailid != "") {
                if (matchArray == null) {
                    document.getElementById("<%=msgLabel.ClientID%>").textContent = "Email address Incorrect";
                    document.getElementById("<%=msgLabel.ClientID%>").style.color = "red";
                    document.getElementById("<%=txtEmail.ClientID %>").focus();
                    return false;
                }

                if (document.getElementById("<%=ddlEmpdesignation.ClientID%>").value == "") {
                    document.getElementById("<%=msgLabel.ClientID%>").textContent = "Please Enter Employee Designation !";
                    document.getElementById("<%=msgLabel.ClientID%>").style.color = "red";
                    document.getElementById("<%=ddlEmpdesignation.ClientID%>").focus();
                    return false;
                }


                if (document.getElementById("<%=txtJoiningDate.ClientID%>").value == "") {
                    document.getElementById("<%=msgLabel.ClientID%>").textContent = "Please EnterEmployee Joining Date !";
                    document.getElementById("<%=msgLabel.ClientID%>").style.color = "red";
                    document.getElementById("<%=txtJoiningDate.ClientID%>").focus();
                    return false;
                }

                if (document.getElementById("<%=ddlEmpProject.ClientID%>").value == "") {
                    document.getElementById("<%=msgLabel.ClientID%>").textContent = "Please Enter Employee Project !";
                    document.getElementById("<%=msgLabel.ClientID%>").style.color = "red";
                    document.getElementById("<%=ddlEmpProject.ClientID%>").focus();
                    return false;
                }


                if (document.getElementById("<%=ddempCatagory.ClientID%>").value == "") {
                    document.getElementById("<%=msgLabel.ClientID%>").textContent = "Please Enter Employee Catagory!";
                    document.getElementById("<%=msgLabel.ClientID%>").style.color = "red";
                    document.getElementById("<%=ddempCatagory.ClientID%>").focus();
                    return false;
                }

            }
            return true;
        }
       
    </script>
    <fieldset>
        <legend>Employee Personal Info</legend>
        <div align="center">
            <asp:Label runat="server" ID="msgLabel"></asp:Label></div>
        <table id="AddEmployeeInfoTB">
            <tr>
                <td class="Label">
                    Employee Code
                </td>
                <td class="Field">
                    <p id="employeeCode" runat="server" class="CodeMsg">
                    </p>
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Name
                </td>
                <td class="Field">
                    <input type="text" runat="server" id="txtName" class="textboxinput" /><span class="estaricStar">*</span>
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Father's Name
                </td>
                <td class="Field">
                    <input type="text" runat="server" id="txtFname" class="textboxinput" />
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Mother's name
                </td>
                <td class="Field">
                    <input type="text" runat="server" id="txtMname" class="textboxinput" />
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Sex
                </td>
                <td class="Field">
                    <select id="ddlsex" runat="server" class="dropdownCss">
                        <option value="default">--Choose Any--</option>
                        <option value="Male">Male</option>
                        <option value="Female">Female</option>
                    </select><span class="estaricStar">*</span>
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Blood Group
                </td>
                <td class="Field">
                    <select id="ddbloodgroup" runat="server" class="dropdownCss">
                        <option value="default">--Choose Any--</option>
                        <option value="A+">A+</option>
                        <option value="A-">A-</option>
                        <option value="B+">B+</option>
                        <option value="B-">B-</option>
                        <option value="O+">O+</option>
                        <option value="O-">O-</option>
                        <option value="AB+">AB+</option>
                        <option value="AB-">AB-</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Date Of Birth
                </td>
                <td class="Field">
                    <input type="text" runat="server" id="txtDob" class="textboxinput" readonly onclick="GetDate(this);" /><span
                        class="estaricStar">*</span>
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Email
                </td>
                <td class="Field">
                    <input type="text" runat="server" id="txtEmail" class="textboxinput" />
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Nationality
                </td>
                <td class="Field">
                    <input type="text" runat="server" id="txtnationality" class="textboxinput" />
                </td>
            </tr>
            <tr>
                <td class="Label">
                    National ID
                </td>
                <td class="Field">
                    <input type="text" runat="server" id="txtNationalID" class="textboxinput" />
                </td>
            </tr>
        </table>
    </fieldset>
    <fieldset>
        <legend>Professional Info</legend>
        <table class="ProfessionalInfoTB">
            <tr>
                <td class="Label">
                    Designation
                </td>
                <td class="Field">
                    <select id="ddlEmpdesignation" runat="server" class="dropdownCss">
                    </select><span class="estaricStar">*</span>
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Skill
                </td>
                <td class="Field">
                    <input type="text" runat="server" id="txtSkill" class="textboxinput" />
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Joining Date
                </td>
                <td class="Field">
                    <input type="text" runat="server" id="txtJoiningDate" class="textboxinput" readonly
                        onclick="GetDate(this);" /><span class="estaricStar">*</span>
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Contact Finish Date
                </td>
                <td class="Field">
                    <input type="text" runat="server" id="txtContatFinishDate" class="textboxinput" readonly
                        onclick="GetDate(this);" />
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Project
                </td>
                <td class="Field">
                    <select id="ddlEmpProject" runat="server" class="dropdownCss">
                    </select><span class="estaricStar">*</span>
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Employee Catagory
                </td>
                <td class="Field">
                    <select id="ddempCatagory" runat="server" class="dropdownCss">
                    </select><span class="estaricStar">*</span>
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Status
                </td>
                <td class="Field">
                    <select id="ddStatus" runat="server" class="dropdownCss">
                        <option>--Choose Any--</option>
                        <option>Active</option>
                        <option>In Active</option>
                        <option>Retire</option>
                        <option>OSD</option>
                    </select>
                </td>
            </tr>
        </table>
    </fieldset>
    <fieldset>
        <legend>Educatinal Info</legend>
        <table class="EducationalInfoTB">
            <tr>
                <td class="Label">
                    Education
                </td>
                <td class="Field">
                    <input type="text" runat="server" id="txtEducation" class="textboxinput" /><br />
                    <span class="lastExam">(Last Exam name)</span>
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Resume
                </td>
                <td class="Field">
                    <input type="file" id="uploadresume" runat="server" class="inputUplodbox" />
                </td>
            </tr>
            <tr>
                <td class="Label">
                </td>
                <td class="Field">
                    <input type="submit" runat="server" id="Submit3" onserverclick="SaveEmployee" value="Save"
                        class="btnCss" onclick="return CheckValidation()" />
                    <input type="submit" value="Next &gt;&gt;" id="btnNext" class="btnCss" runat="server" />
                </td>
            </tr>
        </table>
    </fieldset>
</asp:Content>
